Domain builders need only set bit 9 of EFLAGS (Interrupt Enable).
Setting this bit is enforced by Xen.
Signed-off-by: Keir Fraser <keir@xensource.com>
ctxt->user_regs.eip = vkern_entry;
ctxt->user_regs.esp = vstartinfo_start + 2*PAGE_SIZE;
ctxt->user_regs.esi = vstartinfo_start;
- ctxt->user_regs.eflags = (1<<9) | (1<<2);
+ ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
/* FPU is set up to default initial state. */
memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
/* why is this set? */
ctxt->user_regs.esi = ctxt->user_regs.esp;
- ctxt->user_regs.eflags = (1 << 9) | (1 << 2);
+ ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
/* FPU is set up to default initial state. */
memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
ctxt->user_regs.esi = vboot_params_start;
ctxt->user_regs.edi = vboot_params_start + 0x2d0;
- ctxt->user_regs.eflags = (1<<2);
+ ctxt->user_regs.eflags = 0;
return 0;
memcpy(&ed->arch.guest_context, c, sizeof(*c));
- /* IOPL privileges are virtualised. */
- ed->arch.iopl = (ed->arch.guest_context.user_regs.eflags >> 12) & 3;
- ed->arch.guest_context.user_regs.eflags &= ~EF_IOPL;
+ if ( !(c->flags & VGCF_VMX_GUEST) )
+ {
+ /* IOPL privileges are virtualised. */
+ ed->arch.iopl = (ed->arch.guest_context.user_regs.eflags >> 12) & 3;
+ ed->arch.guest_context.user_regs.eflags &= ~EF_IOPL;
- /* Clear IOPL for unprivileged domains. */
- if ( !IS_PRIV(d) )
- ed->arch.guest_context.user_regs.eflags &= 0xffffcfff;
+ /* Ensure real hardware interrupts are enabled. */
+ ed->arch.guest_context.user_regs.eflags |= EF_IE;
+ }
if ( test_bit(EDF_DONEINIT, &ed->flags) )
return 0;